<!--<?php
$houseHireModule = $_viewer->houseHireModule;
$brokerModule = $_viewer->brokerModule;
print <<<EOT
-->
<script type="text/javascript" src="js/uploader.js"></script>
<script src="mode/house/js/manage.js"></script>
<script src="mode/house/js/validate.js"></script>
<style type="text/css" media="screen">
	@import url(images/post/c_editor/editor.css);
</style>
<script type="text/javascript">
	var winduid = '{$GLOBALS[winduid]}';
	var allowmutinum = '{$_viewer->attachnum}';
	var allow_ext = ' gif  png  jpeg  jpg ';//'{$filetype}';
	uploader.maxLength = '{$_viewer->attachnum}';
	function optionType(value){
		var optionType = getObj('option_type');
		optionType.value = value;
		return validateForm();
	}
	var ifbroker = '$_viewer->ifbroker';
	function validateSubject(e){
		return verify('isempty',e,function(){
				if(arguments[0]){
					message('subject_tips','','');
				}else{
					message('subject_tips','房源标题不能为空','tip tip-error');
				}
			});
	}
	function validateVillage(e){
		return verify('isempty',e,function(){
				if(arguments[0]){
					message('village_tips','','');
				}else{
					message('village_tips','请输入小区名或路名','tip tip-error');
				}
			});
	}
	function validateAddress(e){
		return verify('isempty',e,function(){
				if(arguments[0]){
					message('address_tips','','');
				}else{
					message('address_tips','请填写具体地址','tip tip-error');
				}
			});
	}
	function validateAcreage(e){
		return verify('isfloat',e,function(){
			if(arguments[0]){
					message('acreage_tips','','');
				}else{
					message('acreage_tips','出租面积为必填,且为小数或整数','tip tip-error');
				}
			});
	}
	function validatePrice(e){
		return verify('isfloat',e,function(){
			if(arguments[0]){
					message('price_tips','','');
				}else{
					message('price_tips','租金为必填,且为整数','tip tip-error');
				}
			});
	}
	function validateArea(e){
		return verify('isint',e,function(){
			if(arguments[0]){
					message('area_tips','','tip');
				}else{
					message('area_tips','区域为必选项','tip tip-error');
				}
			});
	}
	function validateLinkman(e){
		return verify('isempty',e,function(){
				if(arguments[0]){
					message('linkman_tips','','');
				}else{
					message('linkman_tips','如果你不是经纪人，联系人必填哦','tip tip-error');
				}
			});
	}
	function validatePhone(e){
		var result = verify('isempty',e);
		if(result){
			result = verify('isphone',e,function(){
					if(arguments[0]){
						message('phone_tips','','');
					}else{
						message('phone_tips','请填写正确格式的手机号码','tip tip-error');
					}
				});
		}else{
			message('phone_tips','','');
		}
		return result;
	}
	function validateTel(e){
		var result = verify('isempty',e);
		if(result){
			result = verify('istel',e,function(){
					if(arguments[0]){
						message('tel_tips','','');
					}else{
						message('tel_tips','请填写正确格式的电话号码','tip tip-error');
					}
				});
		}else{
			message('tel_tips','','');
		}
		return result;
	}

	function validateBrokerLink(){
		var ifphone =  verify('isempty','phone');
		var iftel = verify('isempty','tel');
		var phone = validatePhone('phone');
		var tel = validateTel('tel');
		if(ifphone && iftel){
			return phone && tel;
		}else if(!ifphone && !iftel){
			return validatePhoneOrTel();
		}else{
			return phone || tel;
		}
		return true;
	}
	
	function validatePhoneOrTel(){
		var phone = verify('isempty','phone');
		var tel = verify('isempty','tel');
		if(!phone && !tel){
			message('tel_tips','固定电话与手机号码至少填写一项','tip tip-error');
			return false;
		}else{
			//message('tel_tips','','');
			return true;
		}
		return true;
	}
	function validateFloor(){
		var totalfloor,currentfloor
		currentfloor = verify('isint','currentfloor',function(){
				if(arguments[0] == true){
					    totalfloor = verify('isint','totalfloor',function(){
						if(arguments[0] == true){
							message('floor_tips','','');
						}else{
							message('floor_tips','总楼层必须为数字','tip tip-error');
							return false;
						}});
				}else{
					message('floor_tips','当前楼层必须为数字','tip tip-error');
					return false;
				}});
		var current = parseInt(getObj('currentfloor').value);
		var total = parseInt(getObj('totalfloor').value);
		if(current > total){
			message('floor_tips','当前楼层必须不大于总楼层','tip tip-error');
			return false;
		}
		return true;
	}

	function validateForm(){
		var subject,area,village,address,floor,acreage,price,linkman,iftrue;
		subject = validateSubject('subject');
		area = validateArea('area');
		village = validateVillage('village');
		address = validateAddress('address');
        floor = validateFloor();
        acreage = validateAcreage('acreage');
        price = validatePrice('price');
		if(ifbroker == ''){
			linkman = validateLinkman('linkman');
			iftrue = validateBrokerLink();
		}else{
			linkman = iftrue = true;
		}
		if(subject && village && address  && price && area && floor && acreage && linkman && iftrue){
			 return true;
		}
		return false;
	}

			
</script>
		<div class="fr w-773">
			<div class="form">
				<h3 class="cur-title mb10">发布出租</h3>
				<p class="form-info">$_viewer->tips</p>
				<form action="{$_viewer->url}" method="post" name="FORM"  enctype = "multipart/form-data" >
				<input class="input input_wb" name="step"  type="hidden" value="2"/>
				<input class="input input_wb" name="info[type]"  type="hidden" value="0" id="option_type"/>
				<input class="input input_wb" name="info[from]"   type="hidden" value="{$_viewer->from}"/>
				<h3 class="field-title mb10">基本资料</h3>
				<ul class="field mb20">
					<li class="item">
						<label class="label">标题 <em class="s1">*</em></label>
						<div class="inputs">
							<input id="subject" onblur="validateSubject(event)" class="input input_wb" name="info[subject]"  value="{$houseHireModule->subject}" type="text" />
							<span   id="subject_tips"></span>
						</div>
					</li>
					<li class="item">
						<label class="label">物业类型</label>
						<div class="inputs">
							<select name="info[housetype]" class="select_wa">
<!--
EOT;
foreach ($_viewer->house as $key => $value ) {
if($houseHireModule->housetype == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$value</option>
<!--
EOT;
}
print<<<EOT
-->									
							</select>
						</div>
					</li>	
					<li class="item">
						<label class="label">户型</label>
						<div class="inputs">
							<span class="mr5">
								<select name="info[room][bedroom]">
								
<!--
EOT;
foreach ($_viewer->buildroom['bedroom']['value'] as $key => $value ) {
if($houseHireModule->room['bedroom'] == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$key</option>
<!--
EOT;
}
print<<<EOT
-->										
								</select> {$_viewer->buildroom[bedroom][name]}
							</span>
							<span class="mr5">
								<select name="info[room][hall]">
									
<!--
EOT;
foreach ($_viewer->buildroom['hall']['value'] as $key => $value ) {
if($houseHireModule->room['hall'] == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$key</option>
<!--
EOT;
}
print<<<EOT
-->										
								</select> {$_viewer->buildroom[hall][name]}
							</span>
							<span class="mr5">
							<select name="info[room][toilet]">
								
<!--
EOT;
foreach ($_viewer->buildroom['toilet']['value'] as $key => $value ) {
if($houseHireModule->room['toilet'] == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$key</option>
<!--
EOT;
}
print<<<EOT
-->									
							</select> {$_viewer->buildroom[toilet][name]}
							</span>
							<span class="mr5">
								<select name="info[room][terrace]">						
<!--
EOT;
foreach ($_viewer->buildroom['terrace']['value'] as $key => $value ) {
if($houseHireModule->room['terrace'] == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$key</option>
<!--
EOT;
}
print<<<EOT
-->									
								
							</select> {$_viewer->buildroom[terrace][name]}
							</span>
						</div>
					</li>
					<li class="item">
						<label class="label">小区名<em class="s1">*</em></label>
						<div class="inputs">
							<input id="village" onblur="validateVillage(event)" class="input input_wb" name="info[village]" value="{$houseHireModule->village}" />
							<span   id="village_tips"></span>
						</div>
					</li>
					<li class="item">
						<label class="label">区域 <em class="s1">*</em></label>
						<div class="inputs">
							<select id="area" onblur="validateArea(event)" name="info[areatype]" class="select_wa" onchange="getPlateByAreaId(this.value,'plate','{$houseHireModule->plate}')">
								<option value="0">请选择区域</option>
<!--
EOT;
foreach ($_viewer->area as $key => $value ) {
if($houseHireModule->areatype == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$value</option>
<!--
EOT;
}
print<<<EOT
-->									
							</select>
							<span   id="area_tips"></span>
						</div>
					</li>
<!--
EOT;
print<<<EOT
-->						
					<li class="item" id="plate" style="display:none">
					</li>
<!--
EOT;
print<<<EOT
-->
					<li class="item">
						<label class="label">具体地址 <em class="s1">*</em></label>
						<div class="inputs">
							<input id="address" onblur="validateAddress(event)" class="input input_wa" name="info[address]" value="{$houseHireModule->address}" />
							<span   id="address_tips"></span>
						</div>
					</li>
					<li class="item"><label class="label">楼层</label>
						<div class="inputs">
							第 <input id="currentfloor" onblur="validateFloor()" class="input input_wc" style="width:40px" name="info[currentfloor]" value="{$houseHireModule->currentfloor}" /> 层 / 共 <input id="totalfloor" onblur="validateFloor()" class="input input_wc" style="width:40px" name="info[totalfloor]" value="{$houseHireModule->totalfloor}" /> 层
							<span   id="floor_tips"></span>
						</div>
					</li>
					<li class="item">
						<label class="label">出租面积<em class="s1">*</em></label>
						<div class="inputs">
							<input id="acreage" onblur = "validateAcreage(event)" class="input input_wc" name="info[acreage]" value="{$houseHireModule->acreage}" /> 平方米
							<span   id="acreage_tips"></span>
						</div>
					</li>
					<li class="item">
						<label class="label">建筑年代</label>
						<div class="inputs">
							<select name="info[buildtime]" class="select_wa">
								<option value="0">请选择年代</option>
<!--
EOT;
foreach ($_viewer->buildtime as $key => $value ) {
if($houseHireModule->buildtime == $key){ $sel = 'selected="selected"';}else{ $sel = ''; };
print<<<EOT
-->							
								<option value="$key" $sel>$value</option>
<!--
EOT;
}
print<<<EOT
-->									
							</select>
						</div>
					</li>
					<li class="item">
						<label class="label">租赁方式 <em class="s1">*</em></label>
						<div class="inputs">
                            <ul class="input-list list-w85">
<!--
EOT;
foreach ($_viewer->buildhire as $key => $value ) {
if($houseHireModule->hiretype == $key){ $check = 'checked="checked"';}else{ $check = ''; };
if(!$check  && !$houseHireModule->hiretype && $key == 1){ $check = 'checked="checked"';}
print<<<EOT
-->						
                                <li><input type="radio" id="hiretype_{$key}" name="info[hiretype]" value="$key" $check /><label for="hiretype_{$key}">$value</label></li>
<!--
EOT;
}
print<<<EOT
-->								
                            </ul>
						</div>
					</li>					
					<li class="item">
						<label class="label">租金 <em class="s1">*</em></label>
						<div class="inputs">
							<input id="price" onblur="validatePrice(event)" class="input input_wc" name="info[price]" value="{$houseHireModule->price}" /> 元/月
							<span   id="price_tips"></span>
						</div>
					</li>
					<li class="item">
						<label class="label">交通状况</label>
						<div class="inputs">
							<input class="input input_wb" name="info[traffic]" value="{$houseHireModule->traffic}" />
						</div>
					</li>
<!-- 
EOT;
if($_viewer->ifbroker){
print <<<EOT
-->  				
						
					<li class="item">
						<label class="label">收费与否</label>
						<div class="inputs">
                        	<ul class="input-list">

<!--
EOT;
foreach ($_viewer->buildcharge as $key => $value ) {
if($houseHireModule->ischarge == $key){ $check = 'checked="checked"';}else{ $check = ''; };
if(!$check  && !$houseHireModule->ischarge && $key == 2){ $check = 'checked="checked"';}
print<<<EOT
-->							<li><input type="radio" id="ischarge_{$key}" name="info[ischarge]" value="$key" $check /><label for="ischarge_{$key}">$value</label></li>
<!--
EOT;
}
print<<<EOT
-->	
                            </ul>
						</div>
					</li>					
<!-- 
EOT;
}
print <<<EOT
-->  
				</ul>
				<h3 class="field-title mb10">补充资料</h3>
				<ul class="field mb20">
					<li class="item">
						<label class="label">装修程度</label>
						<div class="inputs">
							<ul class="input-list list-w85">
<!--
EOT;
foreach ($_viewer->fitment as $key => $value ) {
if($houseHireModule->fitment == $key){ $check = 'checked="checked"';}else{ $check = ''; };
print<<<EOT
-->							
							<li><input type="radio" id="fitment_{$key}" name="info[fitment]" value="$key" $check /><label for="fitment_{$key}">$value</label></li>
<!--
EOT;
}
print<<<EOT
-->								

							</ul>
						</div>
					</li>
					<li class="item"><label class="label">配套设施</label>
						<div class="inputs">
							<ul class="input-list list-w85">
<!--
EOT;
foreach ($_viewer->amenities as $key => $value ) {
$amenitie = explode(',',$houseHireModule->equipment);
if(in_array($key,$amenitie)){ $check = 'checked="checked"';}else{ $check = ''; };
print<<<EOT
-->							
							<li><input type="checkbox" id="equipment_{$key}" name="info[equipment][]" value="$key" $check /><label for="equipment_{$key}">$value</label></li>														
<!--
EOT;
}
print<<<EOT
-->								
							</ul>
						</div>
					</li>
					<li class="item">
						<label class="label">房源描述</label>
						<div class="inputs">
						
						
<!--
EOT;
$atc_content = $houseHireModule->descrip;
require_once PrintEot('wysiwyg_editor');
print <<<EOT
-->
							<script type="text/javascript" language="JavaScript" src="js/core/core.js"></script>
							<script type="text/javascript" language="JavaScript" src="js/pw_ajax.js"></script>
							<script language="JavaScript" src="js/post.js"></script>
							<script language="JavaScript" src="js/global.js"></script>
							<script language="JavaScript" src="data/bbscache/face.js"></script>
							<div id="menu_face" class="menu" style="display:none;"></div>
							<div id="menu_generalface" class="menu" style="display:none;"></div>
							<script type="text/javascript">editor.init('wysiwyg', 0);</script>
						</div>	
									
						
					</li>
<!-- 
EOT;
if($_viewer->allowupload && $_viewer->_G['allowupload']){
print <<<EOT
--> 
			<li class="item">
			<label class="label">房源图片</label>
			<div class="inputs">							
			<div class="w_editor_up">
				<div style="height: 23px;">
					<div class="fr" style="line-height: 18px; padding: 5px 0pt 0pt 10px;"></div>
					<ul class="w_tab_a cc">
						<li id="formUploadBtn" style="display:none"><a hidefocus="true" href="javascript:uploader.singleTab();">普通上传</a></li>
						<li id="batUploadBtn" style="display:none"><a hidefocus="true" href="javascript:uploader.mutiTab();">批量上传</a></li>
<!--
EOT;
if ($mutiupload > 0 && 0) {print <<<EOT
-->
					    <li id="flashAtt_use" class="none_css"><a hidefocus="true" href="javascript:uploader.init();" style="padding-right:0;">已有附件($mutiupload)</a></li>
					    <li id="flashAtt_clear" class="none_css"><a hidefocus="true" href="javascript:uploader.clear();">清空已有附件&nbsp;</a></li>
<!--
EOT;
}print <<<EOT
-->
				    	<li class="none_css"><a style="padding-right: 14px;" class="wy_tips" href="javascript:;">&nbsp;可上传类型<i style="width: 250px;">{$filetypeinfo}</i></a></li>
				   	</ul>
				</div>				
				
				<div class="w_editor_up_con">
<!--
EOT;
if($houseHireModule->attachs){
$attachs = initAttach($houseHireModule->attachs);
print <<<EOT
-->
<table cellpadding="0" cellspacing="0" style="display:none" width="100%">
<tbody id="att_mode"><tr>
    <td><input class="input" type="file" name="attachment_" size="20" /></td><td><input class="input" type="text" name="atc_desc" size="20" /></td>
    <td><select style="display:none;"><option value="0"></option><option value="1">加密</option><option value="2">出售</option></select></td>
    <td><select name="att_ctype" style="display:none;">{$alltype}</select></td>
    <td><input class="input" type="hidden" name="atc_needrvrc" value="0" size="1" /></td>
    <td></td></tr>
</tbody>
</table>
						<div class="cc">该帖包含附件<span class="gray">(不想保留的附件去掉√)</span> :
							<table class="tr_p10">
								<tr>
									<td width="11"></td>
									<td width="186">附件</td>
									<td width="180">描述</td>
									<td width="100"></td>
								</tr>
								<tbody id="ajaxtable"></tbody>
							</table>
						</div>
<script type="text/javascript" language="JavaScript" src="js/upload.js"></script>
<script language="JavaScript">
var stylepath = "{$_viewer->stylepath}";
var attachs = {{$attachs}};
oldAtt.init();
</script>
<!--
EOT;
}print <<<EOT
-->
					<div class="cc">
<!--已包含的附件的列表-->
						<table id="attach" class="tr_p10">
							<thead>
								<tr valign="top" id="formUpload">
									<td width="200">上传附件 (图片、文件等)</td>
									<td width="180">描述</td>
									<td width="100">&nbsp;</td>
								</tr>
							</thead>
							<tbody></tbody>
							<!--模板-->
							<tfoot id="singleUploadMod">
								<tr>
									<td class="uploadfilename" width="200"><input type="file" name="attachment" onchange="uploader.insert(this)" /></td>
									<td width="180"><input type="text" name="atc_desc" /></td>
									<td width="100">&nbsp;</td>
								</tr>
							</tfoot>
						</table>
<!--待批量上传的文件-->
						<table style="margin-bottom: 10px;display:none;" class="uploadFileInfo" id="uploadFileInfo">
							<thead>
								<tr>
									<td width="60%">文件名</td>
									<td width="15%">大小</td>
									<td width="20%">上传进度</td>
									<td width="5%">删</td>
								</tr>
							</thead>
							<tbody id="qlist">
							</tbody>
						</table>
 						<div class="menu menu_img" id="viewimg" style="display:none"></div>
					</div>
					<div id="batUpload">
						<div style="width: 100%;">
							<div id="flashUploadPanel"></div>
						</div>
					</div>
					<div class="c"></div>
				</div>
			</div>
<!--编辑器结束-->				
				
			</div>	
				</li>
<!--
EOT;
}print <<<EOT
-->					
					
				</ul>
				<h3 class="field-title mb10">基本资料</h3>
<!-- 
EOT;
if($_viewer->ifbroker){
print <<<EOT
-->  				
				<ul class="field mb20">
					<li class="item"><label class="label">联系人</label>
						<div class="inputs">
							<span>{$brokerModule->realname}</span>
							<!--span class="tips"></span-->
						</div>
					</li>
					<li class="item"><label class="label">手机号码</label>
						<div class="inputs">
							<span>{$brokerModule->phone}</span>
						</div>
					</li>
					<li class="item"><label class="label">固定电话</label>
						<div class="inputs">
							<span>{$brokerModule->tel}</span>
						</div>
					</li>
			</ul>
<!-- 
EOT;
}else{
print <<<EOT
-->	
				<ul class="field mb20">
					<li class="item"><label class="label">联系人<em class="s1">*</em></label>
						<div class="inputs">
							<input id="linkman" onblur="validateLinkman(event)" class="input input_wa" name="info[linkman]" value="{$houseHireModule->linkman}" />
							<span  id="linkman_tips"></span>
						</div>
					</li>
					<li class="item"><label class="label">手机号码</label>
						<div class="inputs">
							<input id="phone" onblur="validatePhone(event)" class="input input_wa" name="info[phone]" value="{$houseHireModule->phone}" />
							<span  id="phone_tips">固定电话与手机号码至少填写一项</span>
						</div>
					</li>
					<li class="item"><label class="label">固定电话</label>
						<div class="inputs">
							<input id="tel" onblur="validateTel(event)" class="input input_wa" name="info[tel]" value="{$houseHireModule->tel}" />
							<span  id="tel_tips">固定电话与手机号码至少填写一项</span>
						</div>
					</li>
				</ul>
<!-- 
EOT;
}
print <<<EOT
-->					
				<div class="action">
					<p class="checkbox">
						<input id="item" type="checkbox" name="info[item]" checked/>
						<label for="item">我已阅读并完全同意房源</label>
						<a href="javascript:void(0)"  onclick="housePermit()">发布协议</a>
					</p>	
					<p>
<!-- 
EOT;
if($houseHireModule->state == 1){
print <<<EOT
-->	
						<button type="submit" class="HM-btn" onclick="scroll(0,0);return validateForm()">保存</button>&nbsp;&nbsp;<button type="submit" class="HM-btn" onclick="return optionType(1)">同意房源发布规范,确认发布</button>		
<!-- 
EOT;
}elseif($houseHireModule->state == 2){
print <<<EOT
-->					
						
						<button type="submit" class="HM-btn" onclick="scroll(0,0);return validateForm()">同意房源发布规范,重新发布</button>
<!-- 
EOT;
}else{
print <<<EOT
-->		
						<button type="submit" class="HM-btn" onclick="scroll(0,0);return validateForm()">同意房源发布规范,确认发布 </button>
<!-- 
EOT;
}
print <<<EOT
-->							
					</p>
				</div>
				</form>
			</div>
		</div>
        <div class="c"></div>
<!--
EOT;
?>-->